package edu.nf.ch07;

import com.github.pagehelper.PageInfo;
import edu.nf.ch07.entity.City;
import edu.nf.ch07.mapper.CityMapper;
import edu.nf.ch07.service.CityService;

import java.util.List;

/**
 * @author wangl
 * @date 2025/4/25
 */
public class Main {

    public static void main(String[] args) {
        CityService service = new CityService();
        //List<City> list = service.pageCity(0, 10);
        PageInfo<City> pageInfo = service.pageCity2(1, 10);
        System.out.println("当前页：" + pageInfo.getPageNum());
        System.out.println("上一页：" + pageInfo.getPrePage());
        System.out.println("下一页：" + pageInfo.getNextPage());
        System.out.println("总页数：" + pageInfo.getPages());
        System.out.println("总记录：" + pageInfo.getTotal());
        System.out.println("每页显示：" + pageInfo.getPageSize());
        pageInfo.getList().forEach(city -> System.out.println(city.getCityName()));
    }
}